package com.mlz.mlzmall.ui.activity.act.personal;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.RelativeLayout;
import com.mlz.mlzmall.R;
import com.mlz.mlzmall.ui.activity.act.base.BaseActivity;
import com.mlz.mlzmall.ui.utils.util.LogUtils;


/**
 * Created by Administrator on 2016/5/23.
 */
public class RankGrowthActivity extends BaseActivity{
    private RelativeLayout iv_back_intergation_center;
    private WebView wv_Grow_the_secret;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rankgrowth);
        wv_Grow_the_secret = (WebView)findViewById(R.id.wv_Grow_the_secret);
        iv_back_intergation_center= (RelativeLayout)findViewById(R.id.iv_back_intergation_center);
        iv_back_intergation_center.setOnClickListener(this);
        if(getIntent().getStringExtra("levelDescriptionUrl")!=null)
        {
            updatetotalpoints(getIntent().getStringExtra("levelDescriptionUrl"));
        }

    }
    private void updatetotalpoints(String weburl ) {
        wv_Grow_the_secret.getSettings().setJavaScriptEnabled(true);//webview的适配
        wv_Grow_the_secret.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
        wv_Grow_the_secret.getSettings().setUseWideViewPort(true);
        wv_Grow_the_secret.getSettings().setLoadWithOverviewMode(true);
        LogUtils.d("链接"+weburl);
        wv_Grow_the_secret.loadUrl(weburl);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId())
        {
            case R.id.iv_back_intergation_center:
                finish();
                break;
            default:
                break;
        }
    }
}
